package com.ruoyi.awards1.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.DataScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.awards1.mapper.JwTeachAwardsMapper;
import com.ruoyi.awards1.domain.JwTeachAwards;
import com.ruoyi.awards1.service.IJwTeachAwardsService;

/**
 * 教师获奖情况Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-13
 */
@Service
public class JwTeachAwardsServiceImpl implements IJwTeachAwardsService 
{
    @Autowired
    private JwTeachAwardsMapper jwTeachAwardsMapper;

    /**
     * 查询教师获奖情况
     * 
     * @param teaId 教师获奖情况主键
     * @return 教师获奖情况
     */
    @Override
    public JwTeachAwards selectJwTeachAwardsByTeaId(Long teaId)
    {
        return jwTeachAwardsMapper.selectJwTeachAwardsByTeaId(teaId);
    }

    /**
     * 查询教师获奖情况列表
     * 
     * @param jwTeachAwards 教师获奖情况
     * @return 教师获奖情况
     */
    @Override
    @DataScope(deptAlias = "d",userAlias = "d")
    public List<JwTeachAwards> selectJwTeachAwardsList(JwTeachAwards jwTeachAwards)
    {
        return jwTeachAwardsMapper.selectJwTeachAwardsList(jwTeachAwards);
    }

    /**
     * 新增教师获奖情况
     * 
     * @param jwTeachAwards 教师获奖情况
     * @return 结果
     */
    @Override
    public int insertJwTeachAwards(JwTeachAwards jwTeachAwards)
    {
        return jwTeachAwardsMapper.insertJwTeachAwards(jwTeachAwards);
    }

    /**
     * 修改教师获奖情况
     * 
     * @param jwTeachAwards 教师获奖情况
     * @return 结果
     */
    @Override
    public int updateJwTeachAwards(JwTeachAwards jwTeachAwards)
    {
        jwTeachAwards.setUpdateTime(DateUtils.getNowDate());
        return jwTeachAwardsMapper.updateJwTeachAwards(jwTeachAwards);
    }

    /**
     * 批量删除教师获奖情况
     * 
     * @param teaIds 需要删除的教师获奖情况主键
     * @return 结果
     */
    @Override
    public int deleteJwTeachAwardsByTeaIds(Long[] teaIds)
    {
        return jwTeachAwardsMapper.deleteJwTeachAwardsByTeaIds(teaIds);
    }

    /**
     * 删除教师获奖情况信息
     * 
     * @param teaId 教师获奖情况主键
     * @return 结果
     */
    @Override
    public int deleteJwTeachAwardsByTeaId(Long teaId)
    {
        return jwTeachAwardsMapper.deleteJwTeachAwardsByTeaId(teaId);
    }
}
